using System;
using System.Collections.Generic;
using System.Text;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework;


namespace UWBGL_XNA_Lib10
{
  public enum eLevelofDetail { lodLow, lodMed, lodHigh };
  public enum eShadeMode { smFlat, smGouraud };
  public enum eFillMode { fmPoint, fmWireframe, fmSolid };

  public class UWB_DrawHelper
  {
    protected eLevelofDetail mLod;
    protected eShadeMode mShadeMode;
    protected eFillMode mFillMode;

    protected float mPointSize;
    protected Color mColor1;
    protected Color mColor2;

    public UWB_DrawHelper()
    {
      mLod = eLevelofDetail.lodHigh;
      mShadeMode = eShadeMode.smGouraud;
      mFillMode = eFillMode.fmSolid;
    }

    public void resetAttributes()
    {
      mPointSize = 1.0f;
      mColor1 = Color.Black;
      mColor2 = Color.Black;
    }

    public void setLod(eLevelofDetail lod)
    {
      mLod = lod;
    }

    public eLevelofDetail getLod()
    {
      return mLod;
    }

    public virtual void setShadeMode(eShadeMode shadeMode)
    {
      mShadeMode = shadeMode;
    }

    public eShadeMode getShadeMode()
    {
      return mShadeMode;
    }

    public virtual void setFillMode(eFillMode fillMode)
    {
      mFillMode = fillMode;
    }

    public eFillMode getFillMode()
    {
      return mFillMode;
    }

    public Color setColor1(Color color1)
    {
      Color oldColor = mColor1;
      mColor1 = color1;
      return oldColor;
    }

    public Color setColor2(Color color2)
    {
      Color oldColor = mColor2;
      mColor2 = color2;
      return oldColor;
    }

    public float setPointSize(float ptSize)
    {
      float oldPtSize = mPointSize;
      mPointSize = ptSize;
      return oldPtSize;
    }


    // Subclasses return true if they support the draw operation
    // The base class just always returns false for all draw functions
    public virtual bool drawPoint(Vector3 position)
    {
      return false;
    }

    public virtual bool drawLine(Vector3 start, Vector3 end)
    {
      return false;
    }

    public virtual bool drawCircle(Vector3 center, float radius)
    {
      return false;
    }

    public virtual bool drawRectangle(Vector3 corner1, Vector3 corner2)
    {
      return false;
    }

    public virtual bool accumulateModelTransform(
        Vector3 translation,
        Vector3 scale,
        float rotationRadians,
        Vector3 pivot)
    {
      return false;
    }

    public virtual bool pushModelTransform()
    {
      return false;
    }

    public virtual bool popModelTransform()
    {
      return false;
    }

    public virtual bool initializeModelTransform()
    {
      return false;
    }

    public virtual bool transformPoint(ref Vector3 point)
    {
      return false;
    }
  }
}
